var that
export default {
    data () {
        return this.datainit({
            newlists:[],
            mylists:[],
            tab:null
        })
    },

    mounted: function () {
        that = this
        this.id = this.$route.query.id
        this.check()

    },

    methods: {
        user_init:function(){
            that.changgetab(1)
        },
        changgetab:function (index) {
            that.tab=index
            if(that.tab==0){
                that.$post("api/group_task/newlists",null,function (data) {
                    that.newlists=data;
                })
            }
            if(that.tab==1){
                that.$post("api/group_task/mylists",null,function (data) {
                    that.mylists=data;
                })
            }

        },
        join:function (id) {
            that.$post("api/group_task/join",{id:id},function (data) {
                that.$toast("加入成功")
            })
        },
        remove:function (id) {
            that.$post("api/group_task/remove",{id:id},function (data) {
                that.changgetab(1)
            })
        }
    }
}